<template>
  <div class="h-p100 w-p100">
    <div class="box box-ver w-p100 h-p100">
      <div @click="$router.go(-1)"  class="header box box-ac">
        <div class="icon icon-back"></div>
        <div class="box-f1 tx-c">获取驾照</div>
      </div>
      <div class="box-f1 bc-fff of-y-s">
        <div v-for="(item, index) in shopList" :key="index" :value="item" class="shop-item box box-ac">
          <div class="box-f1 box-ver box desc">
            <div class="name">卖家：{{item.name}}</div>
            <div class="qq">QQ：{{item.qq}}</div>
            <div class="name">服务时间：{{item.time}}</div>
          </div>
          <a class="qq-button" target="blank" :href="getHref(item)">联系他</a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'myCollection',
  data () {
    return {
      shopList: [{
        name: '超风666',
        qq: '785860655',
        time: '15:00~23:00'
      }, {
        name: '小龙啊啊啊',
        qq: '807092862',
        time: '07:00~15:00'
      }, {
        name: '杨小西',
        qq: '2583370575',
        time: '14:00~22:00'
      }]
    }
  },
  computed: {
    ...mapState(['userInfo'])
  },
  mounted () {
  },
  methods: {
    getHref (item) {
      let qqNum = item.qq
      let qqSrc = `tencent://message/?uin=${qqNum}&Site=${qqNum}&Menu=yes`
      if (/Android|webOS|iPhone|iPod|BlackBerry|Windows CE|Windows Phone/i.test(navigator.userAgent)) {
        if (window.location.href.indexOf('?pc') < 0) {
          try {
            qqSrc = `http://wpd.b.qq.com/cgi/get_m_sign.php?uin=${qqNum}`
          } catch (e) {

          }
        }
      }
      return qqSrc
    }
  }
}
</script>

<style lang="scss" scoped>
@import '../assets/css/config.scss';
.shop-item{
  padding:.3rem .3rem;
  border-bottom:1px solid $borderColor;
  font-size:.32rem;
  .desc{
    line-height:.5rem;
  }
}
.qq-button{
  display:block;
  background-color:$themeColor;
  color:#FFF;
  padding:0 .3rem;
  font-size:.32rem;
  height:.6rem;
  line-height: .6rem;
  border-radius:.1rem;
}
</style>
